﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel.Discovery;

namespace Devtm.ServiceModel.Discovery
{
    
    internal class DiscoveryItem
    {



        public string Key { get; set; }

        private EndpointDiscoveryMetadata _metadata = null;
        public EndpointDiscoveryMetadata Metadata
        {
            get
            {
                return _metadata;
            }
            set
            {
                _metadata = value;
                _extension = null;
            }
        }


        private Extension _extension = null;
        public Extension Extension
        {
            get
            {

                if (_extension == null)
                {
                    _extension = Extension.UnSerialize(Metadata.Extensions[0]);
                }

                return _extension;
            }

        }
    }


}
